from selenium import webdriver

"""
    drive常用方法，用于模拟控制浏览器
"""

drive = webdriver.Chrome()
# drive.set_window_size(480, 800) # 设置浏览器窗口大小为480(宽)*800(高)
# drive.maximize_window() #设置浏览器为全屏
first_url = "http://www.baidu.com"
drive.get(first_url)
print("now access %s" % first_url)

second_url = "http://news.baidu.com"
drive.get(second_url)
print("now access %s" % second_url)

print("back to %s" % first_url)
drive.back()

print("forward to %s" % second_url)
drive.forward()

# 刷新当前页面
drive.refresh()

drive.quit()


